Force a Variable

At run-time, all variables in the table widget are animated 1 with real-time values.

You can double-click on the value of a variable (or press the ENTER key when it is selected) to open a pop-up window that allows you to:

  • Force:
    change the value of the selected variable. Depending on the variable type, you have the possibility to define its value either in the text field or with the check boxes.
    Watch Window - Forcing a variable
  • Figure 1: Forcing a variable

  • Lock:
    Variables, member variables of a structure and variables in an array may be locked. When a variable is locked, its value is no longer changed by the runtime. You can then force its value from the debugger independently from the runtime operations.

    • The value of a locked variable is displayed with square brackets.

    The variable locking feature can be enabled or disabled via the PLC Options device toolbar button. If enabled, the Lock and Unlock buttons are accessible:

    If disabled (default), the Lock and Unlock buttons are not accessible:


    • If PLC variable locking is enabled, the controller Runtime requires an additional 3% to 10% CPU processing power to manage the PLC variable locking. For the best controller performance, disable PLC variable locking.

  • Unlock:
    Remove the lock on a variable so that it can be changed again by the runtime.